<%@ page pageEncoding="UTF-8" contentType="text/html;charset=UTF-8"%>
<%@ include file="/public/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<link href="../static/bs211/css/bootstrap.min.css" rel="stylesheet">
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
      <script src="../static/bs211/js/html5.js"></script>
    <![endif]-->
<script language="javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script language="javascript">
	function showResult(result) {
		alert("上传后的文件名:" + result);
	}
	function uploadPic() {
		if (!$.trim($('#file').val())) {
			alert('请选择上传文件！');
			return;
		}
		var frm = document.getElementById('uploadFrm');
		frm.action = 'upload.html';
		frm.target = 'upload_iframe';
		frm.method = 'POST';
		frm.encoding = 'multipart/form-data';
		frm.submit();
	}
</script>
</head>
<body>
	<div style="margin:100px auto;width: 500px">
		<fmt:message key="hello" />
		<fmt:message key="hello2" />
		<form id="uploadFrm" action="" method="post" target="upload_iframe"
			enctype="multipart/form-data">
			<input id="file" name="file" type="file"
				onchange="javascript:uploadPic();" />
		</form>
		<div style="display: none;">
			<iframe name="upload_iframe"></iframe>
		</div>
	
		已有的文件，点击可预览<br>
		<c:forEach items="${txtFileList}" var="txtFile">
			<a target="_blank" href="<%=request.getContextPath()%>/docpreview/${txtFile}/index.html">${txtFile}</a>
			<br>
		</c:forEach>
	</div>
</body>
</html>
